Skip to content

Instantly share code, notes, and snippets.

// 复用没有过期的真原画直播流地址
recorderEvents = {
onFetchStreamUrl({ roomid, qn }) {
let oldUrl = sharedStorage.getItem('playurl:room:' + roomid);
if (oldUrl) {
// 有旧的播放地址,检查是否过期
const expires = new URL(oldUrl).searchParams.get('expires');
if ((Date.now() / 1000) + 10 < Number(expires)) {
return oldUrl;
} else {
@trusktr
trusktr / DefaultKeyBinding.dict
Last active May 20, 2024 14:38
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@aspose-com-gists
aspose-com-gists / ppt-to-html-slide-notes.py
Last active May 20, 2024 14:32
Convert PowerPoint PPT or PPTX to HTML in Python
import aspose.slides as slides
# Load the presentation file
pres = slides.Presentation("presentation.pptx")
# Create HTML options
options = slides.export.HtmlOptions()
# Include slide notes
options.notes_comments_layouting.notes_position = slides.export.NotesPositions.BOTTOM_FULL
@polyrabbit
polyrabbit / gdb_bt_group.py
Created September 22, 2023 13:48
Group identical GDB stacks together to provide a cohesive overview of the activities of all threads.
#!/usr/bin/env python3
from collections import defaultdict
import sys
def parse_stacks(bt_file):
stack = []
for line in bt_file:
if line.strip():
stack.append(line)
else:
@two-dogs
two-dogs / # dolphin - 2019-04-05_13-36-12.txt
Created April 21, 2019 03:07
dolphin (kde-mac/kde/dolphin) on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for kde-mac/kde/dolphin on macOS 10.13.6
Build date: 2019-04-05 13:36:12
@cbmeeks
cbmeeks / sid.txt
Last active May 20, 2024 14:30
SID File Format
===========================
SID FILE FORMAT DESCRIPTION
===========================
AUTHORS:
Michael Schwendt (PSID v1 and v2)
Simon White (PSID v2NG, RSID)
Dag Lem (PSID v2NG)
Wilfred Bos (PSID v3, RSID v3, PSID v4, RSID v4)
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 20, 2024 14:29
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@oschannel
oschannel / CHEATSHEET.md
Last active May 20, 2024 14:29
Running PostgreSQL server on Android Phone without rooting

This cheatsheet is for the following video that shows how to Install and Run the PostgreSQL Database server on your Andriod Phone. Watch this video for a complete Demo/Solution: https://youtu.be/7edutr-ALdc

Install Termux:

Once termux is installed open it and use the shell for below commands

  • Install PostgreSQL:

@dpaletti
dpaletti / py_poetry_colab.md
Last active May 20, 2024 14:28
Run python poetry project on Colab

Python Poetry Project on Colab

Clone Github Repository

Move in "/content"

  import os
  os.chdir("/content")

Setup git email and username

@FranklinYu
FranklinYu / README.markdown
Last active May 20, 2024 14:28
links for old versions of Docker for Mac (inspired by docker/for-mac#1120)

links for old versions of Docker for Mac

Deprecated

Docker provides download links in release note. They promised that

(we) will also include download links in release notes for future releases.

Note: